using DG.Tweening;
using UnityEngine;

/// <summary>
/// 物品上下浮动效果
/// </summary>
public class ItemSuspended : MonoBehaviour {
    public float floatAmount = 1f;//浮动范围
    public float duration = 1f;//持续时间
    private void Start() {
        // 上下浮动效果
        transform.DOMoveY(transform.position.y + floatAmount, duration).SetLoops(-1, LoopType.Yoyo);
    }
}